package janelas;

import outros.CampoMask;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.KeyboardFocusManager;
import java.awt.Toolkit;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Set;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;
import javax.swing.JTable;
import javax.swing.KeyStroke;
import javax.swing.ListSelectionModel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.JTableHeader;
import outros.Documento;
import outros.ModeloTabela;
import outros.Util;
import persistencia.DAOArea;
import persistencia.DAOFornecedor;
import persistencia.DAOGrupo;
import persistencia.DAOPatrimonio;
import persistencia.DAOSetor;
import persistencia.DAOSubgrupo;
import transporte.TOArea;
import transporte.TOFornecedor;
import transporte.TOGenerico;
import transporte.TOGrupo;
import transporte.TOPai;
import transporte.TOPatrimonio;
import transporte.TOSetor;
import transporte.TOSubgrupo;

public class Patrimonio extends javax.swing.JInternalFrame implements JanelaPai {
    private DAOArea daoArea = new DAOArea();
    private ArrayList<TOArea> toArea = new ArrayList();
    private DAOGrupo daoGrupo = new DAOGrupo();
    private ArrayList<TOGrupo> toGrupo = new ArrayList();
    private DAOSubgrupo daoSubgrupo = new DAOSubgrupo();
    private ArrayList<TOSubgrupo> toSubgrupo = new ArrayList();
    private DAOFornecedor daoFornecedor = new DAOFornecedor();
    private ArrayList<TOFornecedor> toFornecedor = new ArrayList();
    private DAOSetor daoSetor = new DAOSetor();
    private ArrayList<TOSetor> toSetor = new ArrayList();
    private ArrayList<TOGenerico> situacao;
    private ArrayList<TOGenerico> baixa;
    private ArrayList<TOGenerico> orgao;
    //
    private ModeloTabela modelo;
    private DAOPatrimonio dao = new DAOPatrimonio();
    private TOPatrimonio to = new TOPatrimonio();
    private Util util = new Util();
    private JRadioButton[] radioAquisicao;
    //
    private int anoAtual = Calendar.getInstance().get(Calendar.YEAR);
    private int numeroRegistro = -1;
    private String ultimaBusca[] = new String[5];
    private boolean alterar = false;
    private Set botaoTab = new HashSet(1);
    private int crescente = -1;
    //Constantes
    private final int c_min_car = 3;//Minímo de caracteres na pesquisa
    
    public Patrimonio(ArrayList<TOGenerico> situacao,
                               ArrayList<TOGenerico> baixa,
                               ArrayList<TOGenerico> orgao) {
        HashSet conj = new HashSet(getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
        conj.add(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
        setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, conj);
        initComponents();
        radioAquisicao = new JRadioButton[]{radioAquisicaoCompra,
                                            radioAquisicaoDoacao,
                                            radioAquisicaoLeasing,
                                            radioAquisicaoFabricacao,
                                            radioAquisicaoOutros,};
        this.situacao = situacao;
        this.baixa = baixa;
        this.orgao = orgao;
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-getWidth())/2, (int)((screenSize.height-getHeight())/3), getWidth(), getHeight());
        camDataBaixa.setEditable(false);
        camTipoBaixa.setEnabled(false);
        camDescNum.setEditable(true);
        botaoTab.add(KeyStroke.getKeyStroke("TAB"));
        camObservacoes.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, botaoTab);
        iniciarTabela();
    }

    public void reiniciar() {        
        toArea = daoArea.selecionar("");
        toGrupo = daoGrupo.selecionar("");
        toSubgrupo = daoSubgrupo.getSubgruposPorGrupo(toGrupo.get(0).getNumero());
        toFornecedor = daoFornecedor.selecionar("");
        toSetor = daoSetor.selecionar("");
        preencherComboBox();
        infoTotal.setText("Total de bens: 0");
        novo();
    }

    public void mudarAba(int numero) {
        abas.setSelectedIndex(numero);
        if (numero==0) {
            camNome.setCaretPosition(0);
            camAreaNum.requestFocus();
        } else {
            camBuscaArea.requestFocus();
        }
    }

    private void preencherComboBox() {
        camArea.removeAllItems();
        camGrupo.removeAllItems();
        camSituacao.removeAllItems();
        camFornecedor.removeAllItems();
        camTipoBaixa.removeAllItems();
        camLotacao.removeAllItems();
        camOrgao.removeAllItems();
        camBuscaOrgao.removeAllItems();
        for (int i=0;i<toArea.size();i+=1) {
            camArea.addItem(toArea.get(i).getNome());
        }
        camAreaNum.setText(Integer.toString(toArea.get(0).getNumero()));
        for (int i=0;i<toGrupo.size();i+=1) {
            camGrupo.addItem(toGrupo.get(i).getNome());
        }
        camGrupoNum.setText(Integer.toString(toGrupo.get(0).getNumero()));
        for (int i=0;i<situacao.size();i+=1) {
            camSituacao.addItem(situacao.get(i).getNome());
        }
        for (int i=0;i<toFornecedor.size();i+=1) {
            camFornecedor.addItem(toFornecedor.get(i).getNome());
        }
        for (int i=0;i<baixa.size();i+=1) {
            camTipoBaixa.addItem(baixa.get(i).getNome());
        }
        for (int i=0;i<toSetor.size();i+=1) {
            camLotacao.addItem(toSetor.get(i).getNome());
        }
        camLotacaoNum.setText(Integer.toString(toSetor.get(0).getNumero()));
        for (int i=0;i<orgao.size();i+=1) {
            camOrgao.addItem(orgao.get(i).getNome());
            camBuscaOrgao.addItem(orgao.get(i).getNome());
        }
        trocarSubgrupos();
    }

    private void trocarSubgrupos() {
        camSubgrupo.removeAllItems();
        int grupo = 0;
        try {
            grupo = toGrupo.get(camGrupo.getSelectedIndex()).getNumero();
        } catch (Exception e) {}
        try {
            toSubgrupo = daoSubgrupo.getSubgruposPorGrupo(grupo);
            for (int i=0;i<toSubgrupo.size();i+=1) {
                camSubgrupo.addItem(toSubgrupo.get(i).getNome());
            }
            camSubgrupoNum.setText(Integer.toString(toSubgrupo.get(0).getNumero()));
        } catch (Exception e) {}
    }

    private void iniciarTabela() {
        ArrayList dados = new ArrayList();
        String[] colunas = new String[]{"Area","Grupo","Subgrupo","Número","Nome","Orgão"};
        modelo = new ModeloTabela(dados, colunas);
        tabela.setModel(modelo);
        tabela.setCellSelectionEnabled(false);
        tabela.setRowSelectionAllowed(true);
        tabela.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        tabela.setRowHeight(25);
        for (int i=0;i<6;i+=1) {
            tabela.getColumnModel().getColumn(i).setResizable(false);
        }
        tabela.getColumnModel().getColumn(0).setPreferredWidth(20);
        tabela.getColumnModel().getColumn(1).setPreferredWidth(20);
        tabela.getColumnModel().getColumn(2).setPreferredWidth(20);
        tabela.getColumnModel().getColumn(3).setPreferredWidth(20);
        tabela.getColumnModel().getColumn(4).setPreferredWidth(550);
        tabela.getColumnModel().getColumn(5).setPreferredWidth(20);
        tabela.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e){
                //Ao clicar duas vezes...
                if(e.getClickCount() == 2) {
                    mudarAba(0);
                }
            }
            @Override
            public void mouseReleased(MouseEvent e) {
                preencherCampos();
            }
        });
        tabela.addKeyListener(new KeyAdapter() {
            @Override
            public void keyReleased(KeyEvent e) {
                if (e.getKeyCode()==KeyEvent.VK_UP || e.getKeyCode()==KeyEvent.VK_DOWN) {
                    preencherCampos();
                }
            }
        });
        //modelo.setTabela(tabela, 3);
        tabela.getColumnModel().getColumn(0).setCellRenderer(new CellRenderer());
        tabela.getColumnModel().getColumn(1).setCellRenderer(new CellRenderer());
        tabela.getColumnModel().getColumn(2).setCellRenderer(new CellRenderer());
        tabela.getColumnModel().getColumn(3).setCellRenderer(new CellRenderer());
        tabela.getColumnModel().getColumn(5).setCellRenderer(new CellRenderer());
        final JTableHeader header = tabela.getTableHeader();
        header.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                preencherCampos();
            }
        });
        header.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {
                int vColIndex = tabela.getColumnModel().getColumnIndexAtX(e.getX());
                final int mColIndex = tabela.convertColumnIndexToModel(vColIndex);
                if (mColIndex==4) {
                    if (crescente==1) {
                        crescente = -1;
                    } else {
                        crescente = 1;
                    }
                    Collections.sort(modelo.getLinhas(), new Comparator() {
                        public int compare(Object o1, Object o2) {
                            String[] v1 = (String[])o1;
                            String[] v2 = (String[])o2;
                            Comparable i1 = (Comparable)v1[4];
                            Comparable i2 = (Comparable)v2[4];
                            return (i1.compareTo(i2))*crescente;
                        }
                    });
                    tabela.repaint();
                } else if (mColIndex<4) {
                    if (crescente==1) {
                        crescente = -1;
                    } else {
                        crescente = 1;
                    }
                    Collections.sort(modelo.getLinhas(), new Comparator() {
                        public int compare(Object o1, Object o2) {
                            String[] v1 = (String[])o1;
                            String[] v2 = (String[])o2;
                            Comparable i1 = (Comparable)Integer.parseInt(v1[mColIndex]);
                            Comparable i2 = (Comparable)Integer.parseInt(v2[mColIndex]);
                            return (i1.compareTo(i2))*crescente;
                        }
                    });
                    tabela.repaint();
                }
            }
        });
    }

    private void buscar(int orgao, String area, String grupo, String subgrupo, String numero, String nome) {
        if (nome.length()==0 || nome.length()>=c_min_car) {
            ArrayList<TOPatrimonio> al = dao.selecionar(orgao, area, grupo, subgrupo, numero, util.retirarAcentos(nome));
            if (al==null || al.size()==0) {
                modelo.apagarLinhas();
                infoTotal.setText("Total de bens: 0");
                JOptionPane.showMessageDialog(null, "Nenhum resultado obtido.");
            } else {
                try {
                    ultimaBusca[0] = Integer.toString(this.orgao.get(camBuscaOrgao.getSelectedIndex()).getNumero());
                } catch (Exception e) {
                    ultimaBusca[0] = "";
                }
                ultimaBusca[1] = camBuscaArea.getText();
                ultimaBusca[2] = camBuscaGrupo.getText();
                ultimaBusca[3] = camBuscaSubgrupo.getText();
                ultimaBusca[4] = camBuscaNumero.getText();
                modelo.apagarLinhas();
                for (int i=0;i<al.size();i+=1) {
                    modelo.addRow(new String[]{
                        Integer.toString(al.get(i).getArea()),
                        Integer.toString(al.get(i).getGrupo()),
                        Integer.toString(al.get(i).getSubgrupo()),
                        Integer.toString(al.get(i).getNumero()),
                        al.get(i).getNome(),
                        Integer.toString(al.get(i).getOrgao())});
                }
                infoTotal.setText("Total de bens: "+modelo.getRowCount());
                tabela.setRowSelectionInterval(0, 0);                
                preencherCampos();
                tabela.requestFocus();
                //Pequeno bug: aperto enter no campo número da busca, ele já vai direto pra aba 0
                mudarAba(1);
            }
        } else {
            modelo.apagarLinhas();
            JOptionPane.showMessageDialog(null, "Preencha o campo de busca com pelo menos 3 caracteres ou nenhum para buscar todos os registros.");
        }
    }

    private void preencherCampos() {
        checkGarantia.setVisible(true);
        checkEmprestimo.setVisible(true);
        int area = Integer.parseInt((String)tabela.getValueAt(tabela.getSelectedRow(), 0));
        int grupo = Integer.parseInt((String)tabela.getValueAt(tabela.getSelectedRow(), 1));
        int subgrupo = Integer.parseInt((String)tabela.getValueAt(tabela.getSelectedRow(), 2));
        int numero = Integer.parseInt((String)tabela.getValueAt(tabela.getSelectedRow(), 3));
        int orgaoTabela = Integer.parseInt((String)tabela.getValueAt(tabela.getSelectedRow(), 5));
        to = dao.selecionarRegistro(area, grupo, subgrupo, numero, orgaoTabela, -1);
        if (to!=null) {
            camOrgao.setEnabled(false);
            camArea.setEnabled(false);
            camAreaNum.setEnabled(false);
            camGrupo.setEnabled(false);
            camGrupoNum.setEnabled(false);
            camSubgrupo.setEnabled(false);
            camSubgrupoNum.setEnabled(false);
            camLotacao.setEnabled(true);
            camLotacaoNum.setEnabled(true);
            camArea.setSelectedIndex(getItemPorValor(toArea, to.getArea()));
            camGrupo.setSelectedIndex(getItemPorValor(toGrupo, to.getGrupo()));
            camSubgrupo.setSelectedIndex(getItemPorValor(toSubgrupo, to.getSubgrupo()));
            numeroRegistro = to.getNumero();
            camDescNum.setText(Integer.toString(to.getNumero()));
            camNome.setText(to.getNome());
            camDataEntrada.setText(util.dataToString(to.getDataEntrada()));
            camSituacao.setSelectedIndex(getItemPorValor(situacao, to.getSituacao()));
            //Cerne não tem fornecedores, desative o campo fornecedores...
            if (orgaoTabela==407) {
                camFornecedor.setEnabled(false);
            } else {
                camFornecedor.setEnabled(true);
                camFornecedor.setSelectedIndex(getItemPorValor(toFornecedor, to.getFornecedor()));
            }
            if (to.getBaixa()==1) {
                camDataBaixa.setEditable(true);
                camTipoBaixa.setEnabled(true);
                radioBaixaSim.setSelected(true);
                camDataBaixa.setText(util.dataToString(to.getBaixaData()));
                camTipoBaixa.setSelectedIndex(getItemPorValor(baixa, to.getBaixaTipo()));
            } else {
                camDataBaixa.setEditable(false);
                camTipoBaixa.setEnabled(false);
                radioBaixaNao.setSelected(true);
                camDataBaixa.setText("");
                camTipoBaixa.setSelectedIndex(0);
            }
            camLotacao.setSelectedIndex(getItemPorValor(toSetor, to.getLotacao()));
            camOrgao.setSelectedIndex(getItemPorValor(orgao, to.getOrgao()));
            if (to.getTipo()==2) {
                radioTipoEmprestimo.setSelected(true);
            } else {
                radioTipoAquisicao.setSelected(true);
            }
            try {
                radioAquisicao[to.getAquisicao()-1].setSelected(true);
            } catch (Exception e) {
                radioAquisicaoOutros.setSelected(true);
            }
            if (to.getPenhora()==1) {
                checkOutrosPenhora.setSelected(true);
            }
            if (to.getComodato()==1) {
                checkOutrosComodato.setSelected(true);
            }
            camObservacoes.setText(to.getObs());
            camProcesso.setText(to.getProcesso());
            camChassi.setText(to.getChassi());
            camSerie.setText(to.getSerie());
            camValorMercadoReal.setText(to.getValorMercReal());
            camValorMercadoDolar.setText(to.getValorMercDolar());
            camValorFinalReal.setText(to.getValorFinalReal());
            camValorFinalDolar.setText(to.getValorFinalDolar());
            camNFDataEntrada.setText(util.dataToString(to.getNfData()));
            camNFNumero.setText(Integer.toString(to.getNfNumero()));
            camBloco.setText(Integer.toString(to.getBloco()));
            camPagina.setText(Integer.toString(to.getPagina()));
            camNumeroEstado.setText(Integer.toString(to.getNumeroEstado()));
            if (to.getGarantia()==1) {
                checkGarantia.setSelected(true);
            } else {
                checkGarantia.setSelected(false);
            }
            if (to.getEmprestimo()==1) {
                checkEmprestimo.setSelected(true);
            } else {
                checkEmprestimo.setSelected(false);
            }
        }
        camDescNum.setEnabled(false);
        alterar = true;
    }

    private int getItemPorValor(ArrayList objeto, int valor) {
        ArrayList<TOPai> pai = objeto;
        for (int i=0;i<objeto.size();i+=1) {
            if (pai.get(i).getNumero()==valor) {
                return i;
            }
        }
        return 0;
    }

    private void novo() {
        checkGarantia.setVisible(false);
        checkEmprestimo.setVisible(false);
        modelo.apagarLinhas();
        alterar = false;
        limparCampos();
        camOrgao.setEnabled(true);
        camArea.setEnabled(true);
        camAreaNum.setEnabled(true);
        camGrupo.setEnabled(true);
        camGrupoNum.setEnabled(true);
        camSubgrupo.setEnabled(true);
        camSubgrupoNum.setEnabled(true);
        camLotacao.setEnabled(true);
        camLotacaoNum.setEnabled(true);
        camDescNum.setEnabled(true);
        camDescNum.setText("");
        //botExcluir.setEnabled(false);
    }

    private void limparCampos() {
        camArea.setSelectedIndex(0);
        if (!alterar) {
            numeroRegistro = -1;
            camGrupo.setSelectedIndex(0);
        }
        camNome.setText("");
        camDataEntrada.setText("");
        camSituacao.setSelectedIndex(0);
        camFornecedor.setSelectedIndex(0);
        radioBaixaNao.setSelected(true);
        camDataBaixa.setText("");
        camTipoBaixa.setSelectedIndex(0);
        camLotacao.setSelectedIndex(0);
        camOrgao.setSelectedIndex(0);
        radioTipoAquisicao.setSelected(true);
        checkOutrosPenhora.setSelected(false);
        checkOutrosComodato.setSelected(false);
        radioAquisicaoCompra.setSelected(true);
        camObservacoes.setText("");
        camProcesso.setText("");
        camChassi.setText("");
        camSerie.setText("");
        camValorMercadoReal.setText("");
        camValorMercadoDolar.setText("");
        camValorFinalReal.setText("");
        camValorFinalDolar.setText("");
        camNFDataEntrada.setText("");
        camNFNumero.setText("");
        camBloco.setText("");
        camPagina.setText("");
        camNumeroEstado.setText("");
        camAreaNum.requestFocus();
    }

    private void salvar() {
        if (montaPatrimonio()) {
            if (alterar) {
                if (dao.alterar(to).equals("")) {
                    dao.criarRegistro(to, "Registro alterado.", Integer.parseInt(camDescNum.getText()));
                    JOptionPane.showMessageDialog(null, "Registro alterado com sucesso.");
                    camNome.requestFocus();
                }
            } else {
                if (dao.criar(to).equals("")) {
                    dao.criarRegistro(to, "Registro criado.", Integer.parseInt(camDescNum.getText()));
                    novo();
                    JOptionPane.showMessageDialog(null, "Cadastro efetuado com sucesso.");
                }
            }
        }
    }

    private boolean montaPatrimonio() {
        to.setArea(toArea.get(camArea.getSelectedIndex()).getNumero());
        to.setGrupo(toGrupo.get(camGrupo.getSelectedIndex()).getNumero());
        to.setSubgrupo(toSubgrupo.get(camSubgrupo.getSelectedIndex()).getNumero());
        if (camNome.getText().isEmpty()) {
            camNome.requestFocus();
            JOptionPane.showMessageDialog(null, "Preencha o campo nome.");
            return false;
        } else {
            to.setNome(camNome.getText());
        }
        to.setDataEntrada(camDataEntrada.getText());
        to.setSituacao(situacao.get(camSituacao.getSelectedIndex()).getNumero());
        to.setFornecedor(toFornecedor.get(camFornecedor.getSelectedIndex()).getNumero());
        if (radioBaixaSim.isSelected()) {
            to.setBaixa(1);
            to.setBaixaData(camDataBaixa.getText());
            to.setBaixaTipo(baixa.get(camTipoBaixa.getSelectedIndex()).getNumero());
        } else {
            to.setBaixa(2);
            to.setBaixaData("");
            to.setBaixaTipo(0);
        }
        to.setLotacao(toSetor.get(camLotacao.getSelectedIndex()).getNumero());
        to.setOrgao(orgao.get(camOrgao.getSelectedIndex()).getNumero());
        if (radioTipoAquisicao.isSelected()) {
            to.setTipo(1);
        } else {
            to.setTipo(2);
        }
        if (radioAquisicaoCompra.isSelected()) {
            to.setAquisicao(1);
        } else if (radioAquisicaoDoacao.isSelected()) {
            to.setAquisicao(2);
        } else if (radioAquisicaoLeasing.isSelected()) {
            to.setAquisicao(3);
        } else if (radioAquisicaoFabricacao.isSelected()) {
            to.setAquisicao(4);
        } else {
            to.setAquisicao(5);
        }
        if (checkOutrosPenhora.isSelected()) {
            to.setPenhora(1);
        } else {
            to.setPenhora(0);
        }
        if (checkOutrosComodato.isSelected()) {
            to.setComodato(1);
        } else {
            to.setComodato(0);
        }
        to.setObs(camObservacoes.getText());
        to.setProcesso(camProcesso.getText());
        to.setChassi(camChassi.getText());
        to.setSerie(camSerie.getText());
        to.setValorMercReal(camValorMercadoReal.getText());
        to.setValorMercDolar(camValorMercadoDolar.getText());
        to.setValorFinalReal(camValorFinalReal.getText());
        to.setValorFinalDolar(camValorFinalDolar.getText());
        to.setNfData(camNFDataEntrada.getText());
        try {
            to.setNfNumero(Integer.parseInt(camNFNumero.getText()));
        } catch (Exception e) {
            to.setNfNumero(0);
        }
        try {
            to.setBloco(Integer.parseInt(camBloco.getText()));
        } catch (Exception e) {
            to.setBloco(0);
        }
        try {
            to.setPagina(Integer.parseInt(camPagina.getText()));
        } catch (Exception e) {
            to.setPagina(0);
        }
        try {
            to.setNumeroEstado(Integer.parseInt(camNumeroEstado.getText()));
        } catch (Exception e) {
            to.setNumeroEstado(0);
        }
        return true;
    }

    private boolean setarCombo(String n, String nome, ArrayList lista, JComboBox campo) {
        int num = Integer.parseInt(n);
        for (int i=0;i<lista.size();i+=1) {
            if (((TOPai)lista.get(i)).getNumero()==num) {
                campo.setSelectedIndex(i);
                //proxCampo.requestFocus();
                return true;
            }
        }
        JOptionPane.showMessageDialog(null, nome+" inexistente.");
        return false;
    }

    private void mostrarProximoId() {
        camDescNum.setText(dao.getProximo(
                       Integer.toString(orgao.get(camOrgao.getSelectedIndex()).getNumero()),
                       camAreaNum.getText(),
                       camGrupoNum.getText(),
                       camSubgrupoNum.getText()));
    }

    private void verificarExistenciaNumero(boolean enter) {
        int area = Integer.parseInt(camAreaNum.getText());
        int grupo = Integer.parseInt(camGrupoNum.getText());
        int subgrupo = Integer.parseInt(camSubgrupoNum.getText());
        int numero = Integer.parseInt(camDescNum.getText());
        if (dao.numeroExiste(area, grupo, subgrupo, numero)) {
            camDescNum.requestFocus();            
            mostrarProximoId();
            camDescNum.selectAll();
            JOptionPane.showMessageDialog(null, "Número já existente.", "ALERTA", JOptionPane.WARNING_MESSAGE);
        } else if (enter) {
            camNome.requestFocus();
        }
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        grupoBaixa = new javax.swing.ButtonGroup();
        grupoTipo = new javax.swing.ButtonGroup();
        grupoAquisicao = new javax.swing.ButtonGroup();
        abas = new javax.swing.JTabbedPane();
        aba1 = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        radioBaixaSim = new javax.swing.JRadioButton();
        radioBaixaNao = new javax.swing.JRadioButton();
        camDataBaixa = new CampoMask("##/##/####");
        jLabel9 = new javax.swing.JLabel();
        camTipoBaixa = new javax.swing.JComboBox();
        jLabel10 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        radioTipoAquisicao = new javax.swing.JRadioButton();
        radioTipoEmprestimo = new javax.swing.JRadioButton();
        jPanel4 = new javax.swing.JPanel();
        radioAquisicaoCompra = new javax.swing.JRadioButton();
        radioAquisicaoDoacao = new javax.swing.JRadioButton();
        radioAquisicaoLeasing = new javax.swing.JRadioButton();
        radioAquisicaoFabricacao = new javax.swing.JRadioButton();
        radioAquisicaoOutros = new javax.swing.JRadioButton();
        jPanel5 = new javax.swing.JPanel();
        camValorMercadoReal = new outros.CampoMonetario();
        jLabel13 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        camValorMercadoDolar = new outros.CampoMonetario();
        camValorFinalReal = new outros.CampoMonetario();
        jLabel18 = new javax.swing.JLabel();
        camValorFinalDolar = new outros.CampoMonetario();
        jLabel19 = new javax.swing.JLabel();
        jPanel6 = new javax.swing.JPanel();
        jLabel14 = new javax.swing.JLabel();
        camNFDataEntrada = new CampoMask("##/##/####");
        jLabel20 = new javax.swing.JLabel();
        camNFNumero = new javax.swing.JTextField();
        jPanel7 = new javax.swing.JPanel();
        checkOutrosPenhora = new javax.swing.JCheckBox();
        checkOutrosComodato = new javax.swing.JCheckBox();
        jPanel8 = new javax.swing.JPanel();
        botSalvar = new javax.swing.JButton();
        botLimpar = new javax.swing.JButton();
        botNovo = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        camProcesso = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        camChassi = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        camSerie = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jPanel10 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        camLotacao = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        camOrgao = new javax.swing.JComboBox();
        camLotacaoNum = new javax.swing.JTextField();
        jPanel11 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        camNome = new javax.swing.JTextField();
        camArea = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        camGrupo = new javax.swing.JComboBox();
        camDataEntrada = new CampoMask("##/##/####");
        jLabel5 = new javax.swing.JLabel();
        camSituacao = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        camSubgrupo = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        camFornecedor = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        camAreaNum = new javax.swing.JTextField();
        camGrupoNum = new javax.swing.JTextField();
        camSubgrupoNum = new javax.swing.JTextField();
        camDescNum = new javax.swing.JTextField();
        jPanel12 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        camObservacoes = new javax.swing.JTextArea();
        jPanel2 = new javax.swing.JPanel();
        camBloco = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        camPagina = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        camNumeroEstado = new javax.swing.JTextField();
        checkEmprestimo = new javax.swing.JCheckBox();
        checkGarantia = new javax.swing.JCheckBox();
        aba2 = new javax.swing.JPanel();
        jPanel14 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        camBusca = new javax.swing.JTextField();
        botBuscar = new javax.swing.JButton();
        camBuscaGrupo = new javax.swing.JTextField();
        jLabel25 = new javax.swing.JLabel();
        camBuscaSubgrupo = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        camBuscaNumero = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        camBuscaArea = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        camBuscaOrgao = new javax.swing.JComboBox();
        jScrollPane2 = new javax.swing.JScrollPane();
        tabela = new javax.swing.JTable();
        infoTotal = new javax.swing.JLabel();

        setClosable(true);
        setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        setTitle("Patrimônios");

        abas.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Baixa", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        grupoBaixa.add(radioBaixaSim);
        radioBaixaSim.setFont(new java.awt.Font("Segoe UI", 0, 13));
        radioBaixaSim.setText("Sim");
        radioBaixaSim.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radioBaixaSimActionPerformed(evt);
            }
        });

        grupoBaixa.add(radioBaixaNao);
        radioBaixaNao.setFont(new java.awt.Font("Segoe UI", 0, 13));
        radioBaixaNao.setSelected(true);
        radioBaixaNao.setText("Não");
        radioBaixaNao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                radioBaixaNaoActionPerformed(evt);
            }
        });

        camDataBaixa.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camDataBaixa.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        camDataBaixa.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                camDataBaixaFocusLost(evt);
            }
        });

        jLabel9.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel9.setText("Data baixa");

        camTipoBaixa.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel10.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel10.setText("Tipo");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(radioBaixaSim)
                        .addGap(18, 18, 18)
                        .addComponent(radioBaixaNao))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(camDataBaixa, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(camTipoBaixa, 0, 170, Short.MAX_VALUE)
                            .addComponent(jLabel10))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(radioBaixaSim)
                    .addComponent(radioBaixaNao))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(camDataBaixa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(camTipoBaixa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel9)
                        .addGap(29, 29, 29))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel10)
                        .addGap(30, 30, 30)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Tipo", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        grupoTipo.add(radioTipoAquisicao);
        radioTipoAquisicao.setFont(new java.awt.Font("Segoe UI", 0, 13));
        radioTipoAquisicao.setSelected(true);
        radioTipoAquisicao.setText("Aquisição");

        grupoTipo.add(radioTipoEmprestimo);
        radioTipoEmprestimo.setFont(new java.awt.Font("Segoe UI", 0, 13));
        radioTipoEmprestimo.setText("Empréstimo");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(radioTipoAquisicao)
                    .addComponent(radioTipoEmprestimo))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(radioTipoAquisicao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(radioTipoEmprestimo)
                .addContainerGap())
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Aquisição", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        grupoAquisicao.add(radioAquisicaoCompra);
        radioAquisicaoCompra.setFont(new java.awt.Font("Segoe UI", 0, 13));
        radioAquisicaoCompra.setSelected(true);
        radioAquisicaoCompra.setText("Compra");

        grupoAquisicao.add(radioAquisicaoDoacao);
        radioAquisicaoDoacao.setFont(new java.awt.Font("Segoe UI", 0, 13));
        radioAquisicaoDoacao.setText("Doação");

        grupoAquisicao.add(radioAquisicaoLeasing);
        radioAquisicaoLeasing.setFont(new java.awt.Font("Segoe UI", 0, 13));
        radioAquisicaoLeasing.setText("Leasing");

        grupoAquisicao.add(radioAquisicaoFabricacao);
        radioAquisicaoFabricacao.setFont(new java.awt.Font("Segoe UI", 0, 13));
        radioAquisicaoFabricacao.setText("Fab. Própria");

        grupoAquisicao.add(radioAquisicaoOutros);
        radioAquisicaoOutros.setFont(new java.awt.Font("Segoe UI", 0, 13));
        radioAquisicaoOutros.setText("Outros");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(radioAquisicaoCompra)
                    .addComponent(radioAquisicaoDoacao)
                    .addComponent(radioAquisicaoLeasing)
                    .addComponent(radioAquisicaoFabricacao)
                    .addComponent(radioAquisicaoOutros))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(radioAquisicaoCompra)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(radioAquisicaoDoacao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(radioAquisicaoLeasing)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(radioAquisicaoFabricacao)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(radioAquisicaoOutros))
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Valores", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        camValorMercadoReal.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camValorMercadoReal.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                camValorMercadoRealFocusLost(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel13.setText("Mercado R$");

        jLabel17.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel17.setText("Mercado US$");

        camValorMercadoDolar.setFont(new java.awt.Font("Segoe UI", 0, 13));

        camValorFinalReal.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel18.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel18.setText("Final R$");

        camValorFinalDolar.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel19.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel19.setText("Final US$");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camValorMercadoReal, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camValorMercadoDolar, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel17))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camValorFinalReal, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camValorFinalDolar, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addGroup(jPanel5Layout.createSequentialGroup()
                    .addComponent(jLabel19)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(camValorFinalDolar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel5Layout.createSequentialGroup()
                    .addComponent(jLabel18)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(camValorFinalReal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel5Layout.createSequentialGroup()
                    .addComponent(jLabel17)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(camValorMercadoDolar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel5Layout.createSequentialGroup()
                    .addComponent(jLabel13)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(camValorMercadoReal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Nota Fiscal", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        jLabel14.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel14.setText("Data entrada");

        camNFDataEntrada.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camNFDataEntrada.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        camNFDataEntrada.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                camNFDataEntradaFocusLost(evt);
            }
        });

        jLabel20.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel20.setText("Nº Nota Fiscal");

        camNFNumero.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camNFNumero.setText("123");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camNFDataEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camNFNumero, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE)
                    .addComponent(jLabel20))
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addComponent(jLabel20)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(camNFNumero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addComponent(camNFDataEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel6Layout.createSequentialGroup()
                    .addComponent(jLabel14)
                    .addGap(29, 29, 29)))
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Outros", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        checkOutrosPenhora.setFont(new java.awt.Font("Segoe UI", 0, 13));
        checkOutrosPenhora.setText("Penhora");

        checkOutrosComodato.setFont(new java.awt.Font("Segoe UI", 0, 13));
        checkOutrosComodato.setText("Comodato");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(checkOutrosPenhora)
                    .addComponent(checkOutrosComodato))
                .addContainerGap(14, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(checkOutrosPenhora)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(checkOutrosComodato))
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Ações", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        botSalvar.setFont(new java.awt.Font("Segoe UI", 0, 13));
        botSalvar.setText("Salvar");
        botSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botSalvarActionPerformed(evt);
            }
        });

        botLimpar.setFont(new java.awt.Font("Segoe UI", 0, 13));
        botLimpar.setText("Limpar");
        botLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botLimparActionPerformed(evt);
            }
        });

        botNovo.setFont(new java.awt.Font("Segoe UI", 0, 13));
        botNovo.setText("Novo");
        botNovo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botNovoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(botNovo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botLimpar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(botSalvar)
                .addGap(27, 27, 27))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(botNovo)
                    .addComponent(botLimpar)
                    .addComponent(botSalvar))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Especificações", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        camProcesso.setDocument(new Documento(false, 50, true));
        camProcesso.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel15.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel15.setText("Processo");

        camChassi.setDocument(new Documento(false, 50, true));
        camChassi.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel21.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel21.setText("Chassi");

        camSerie.setDocument(new Documento(false, 50, true));
        camSerie.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel22.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel22.setText("Série");

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel21)
                    .addComponent(camChassi, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
                    .addComponent(jLabel22)
                    .addComponent(camSerie, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
                    .addComponent(jLabel15)
                    .addComponent(camProcesso, javax.swing.GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(jLabel15)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(camProcesso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel22)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(camSerie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel21)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(camChassi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Localização", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        jLabel11.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel11.setText("Lotação");

        camLotacao.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camLotacao.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                camLotacaoItemStateChanged(evt);
            }
        });
        camLotacao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camLotacaoActionPerformed(evt);
            }
        });

        jLabel12.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel12.setText("Órgão");

        camOrgao.setFont(new java.awt.Font("Segoe UI", 0, 13));

        camLotacaoNum.setDocument(new Documento(true, 4));
        camLotacaoNum.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camLotacaoNum.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camLotacaoNumActionPerformed(evt);
            }
        });
        camLotacaoNum.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camLotacaoNumFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                camLotacaoNumFocusLost(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(camLotacaoNum, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(camLotacao, 0, 286, Short.MAX_VALUE))
            .addComponent(camOrgao, 0, 327, Short.MAX_VALUE)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jLabel11)
                .addContainerGap())
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jLabel12)
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(jLabel11)
                .addGap(4, 4, 4)
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(camLotacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camLotacaoNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel12)
                .addGap(4, 4, 4)
                .addComponent(camOrgao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel11.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel4.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel4.setText("Descrição");

        camNome.setDocument(new Documento(false, 100, true));
        camNome.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        camNome.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camNomeFocusGained(evt);
            }
        });

        camArea.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camArea.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                camAreaItemStateChanged(evt);
            }
        });
        camArea.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camAreaActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel1.setText("Área");

        camGrupo.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camGrupo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                camGrupoItemStateChanged(evt);
            }
        });
        camGrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camGrupoActionPerformed(evt);
            }
        });

        camDataEntrada.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camDataEntrada.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        camDataEntrada.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                camDataEntradaFocusLost(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel5.setText("Data entrada");

        camSituacao.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel6.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel6.setText("Situação");

        camSubgrupo.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camSubgrupo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                camSubgrupoItemStateChanged(evt);
            }
        });
        camSubgrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camSubgrupoActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel3.setText("Subgrupo");

        jLabel7.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel7.setText("Fornecedor");

        camFornecedor.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camFornecedor.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                camFornecedorItemStateChanged(evt);
            }
        });

        jLabel8.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel8.setText("Grupo");

        camAreaNum.setDocument(new Documento(true, 4));
        camAreaNum.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camAreaNum.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camAreaNumActionPerformed(evt);
            }
        });
        camAreaNum.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camAreaNumFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                camAreaNumFocusLost(evt);
            }
        });

        camGrupoNum.setDocument(new Documento(true, 4));
        camGrupoNum.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camGrupoNum.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camGrupoNumActionPerformed(evt);
            }
        });
        camGrupoNum.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camGrupoNumFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                camGrupoNumFocusLost(evt);
            }
        });

        camSubgrupoNum.setDocument(new Documento(true, 4));
        camSubgrupoNum.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camSubgrupoNum.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camSubgrupoNumActionPerformed(evt);
            }
        });
        camSubgrupoNum.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camSubgrupoNumFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                camSubgrupoNumFocusLost(evt);
            }
        });

        camDescNum.setDocument(new Documento(true, 4));
        camDescNum.setFont(new java.awt.Font("Segoe UI", 0, 13)); // NOI18N
        camDescNum.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camDescNumActionPerformed(evt);
            }
        });
        camDescNum.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camDescNumFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                camDescNumFocusLost(evt);
            }
        });

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addComponent(camDescNum, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(camNome, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(camDataEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel5))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(camSituacao, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6)))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addComponent(jLabel1)
                                .addGap(179, 179, 179))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel11Layout.createSequentialGroup()
                                .addComponent(camAreaNum, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(camArea, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addComponent(camGrupoNum, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(camGrupo, 0, 341, Short.MAX_VALUE))
                            .addComponent(jLabel8))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                        .addComponent(camSubgrupoNum, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(camSubgrupo, 0, 332, Short.MAX_VALUE))
                    .addComponent(camFornecedor, javax.swing.GroupLayout.Alignment.TRAILING, 0, 294, Short.MAX_VALUE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel7))
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jLabel3)
                            .addComponent(jLabel8))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(camSubgrupo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(camGrupo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(camSubgrupoNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(camArea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(camAreaNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(camGrupoNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7)))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jLabel4)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(camNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camDataEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camSituacao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camDescNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Observações", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        camObservacoes.setDocument(new Documento(false, 50, true));
        camObservacoes.setColumns(20);
        camObservacoes.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camObservacoes.setLineWrap(true);
        camObservacoes.setRows(5);
        camObservacoes.setWrapStyleWord(true);
        jScrollPane1.setViewportView(camObservacoes);

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 457, Short.MAX_VALUE)
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Controle", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Segoe UI", 0, 13))); // NOI18N

        camBloco.setDocument(new Documento(true, 8));
        camBloco.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel16.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel16.setText("Bloco");

        jLabel23.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel23.setText("Página");

        camPagina.setDocument(new Documento(true, 8));
        camPagina.setFont(new java.awt.Font("Segoe UI", 0, 13));

        jLabel24.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel24.setText("Nº Estado");

        camNumeroEstado.setDocument(new Documento(true, 8));
        camNumeroEstado.setFont(new java.awt.Font("Segoe UI", 0, 13));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camBloco, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camPagina, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel23))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel24, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camNumeroEstado, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addComponent(jLabel24)
                    .addGap(30, 30, 30))
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addComponent(jLabel23)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(camPagina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(camNumeroEstado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addComponent(jLabel16)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(camBloco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        checkEmprestimo.setFont(new java.awt.Font("Segoe UI", 0, 13));
        checkEmprestimo.setText("Empréstimo");
        checkEmprestimo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkEmprestimoActionPerformed(evt);
            }
        });

        checkGarantia.setFont(new java.awt.Font("Segoe UI", 0, 13));
        checkGarantia.setText("Garantia");
        checkGarantia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                checkGarantiaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout aba1Layout = new javax.swing.GroupLayout(aba1);
        aba1.setLayout(aba1Layout);
        aba1Layout.setHorizontalGroup(
            aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(aba1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, 905, Short.MAX_VALUE)
                    .addGroup(aba1Layout.createSequentialGroup()
                        .addGroup(aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(aba1Layout.createSequentialGroup()
                                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, aba1Layout.createSequentialGroup()
                                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, aba1Layout.createSequentialGroup()
                                .addGroup(aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(aba1Layout.createSequentialGroup()
                                .addComponent(checkGarantia)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(checkEmprestimo))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, aba1Layout.createSequentialGroup()
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        aba1Layout.setVerticalGroup(
            aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(aba1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(aba1Layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(aba1Layout.createSequentialGroup()
                        .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(aba1Layout.createSequentialGroup()
                        .addGroup(aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(aba1Layout.createSequentialGroup()
                                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(1, 1, 1)
                                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
                        .addGroup(aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(checkEmprestimo)
                            .addComponent(checkGarantia))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(aba1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel5, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(240, 240, 240))
        );

        abas.addTab("Patrimônio", aba1);

        jPanel14.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        jLabel2.setFont(new java.awt.Font("Segoe UI", 0, 13));
        jLabel2.setText("Descrição");

        camBusca.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camBusca.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camBuscaActionPerformed(evt);
            }
        });
        camBusca.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camBuscaFocusGained(evt);
            }
        });

        botBuscar.setFont(new java.awt.Font("Segoe UI", 0, 13));
        botBuscar.setText("Buscar");
        botBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                botBuscarActionPerformed(evt);
            }
        });

        camBuscaGrupo.setDocument(new Documento(true, 5));
        camBuscaGrupo.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camBuscaGrupo.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        camBuscaGrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camBuscaGrupoActionPerformed(evt);
            }
        });
        camBuscaGrupo.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camBuscaGrupoFocusGained(evt);
            }
        });

        jLabel25.setFont(new java.awt.Font("Tahoma", 0, 13));
        jLabel25.setText("Grupo");

        camBuscaSubgrupo.setDocument(new Documento(true, 5));
        camBuscaSubgrupo.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camBuscaSubgrupo.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        camBuscaSubgrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camBuscaSubgrupoActionPerformed(evt);
            }
        });
        camBuscaSubgrupo.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camBuscaSubgrupoFocusGained(evt);
            }
        });

        jLabel26.setFont(new java.awt.Font("Tahoma", 0, 13));
        jLabel26.setText("Subgrupo");

        camBuscaNumero.setDocument(new Documento(true, 5));
        camBuscaNumero.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camBuscaNumero.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        camBuscaNumero.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camBuscaNumeroActionPerformed(evt);
            }
        });
        camBuscaNumero.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camBuscaNumeroFocusGained(evt);
            }
        });

        jLabel27.setFont(new java.awt.Font("Tahoma", 0, 13));
        jLabel27.setText("Número");

        jLabel28.setFont(new java.awt.Font("Tahoma", 0, 13));
        jLabel28.setText("Área");

        camBuscaGrupo.setDocument(new Documento(true, 5));
        camBuscaArea.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camBuscaArea.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        camBuscaArea.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camBuscaAreaActionPerformed(evt);
            }
        });
        camBuscaArea.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                camBuscaAreaFocusGained(evt);
            }
        });

        jLabel29.setFont(new java.awt.Font("Tahoma", 0, 13));
        jLabel29.setText("Órgão");

        camBuscaOrgao.setFont(new java.awt.Font("Segoe UI", 0, 13));
        camBuscaOrgao.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                camBuscaOrgaoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camBuscaArea, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camBuscaGrupo, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(camBuscaSubgrupo, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel27)
                    .addComponent(camBuscaNumero, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2)
                    .addComponent(camBusca, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                        .addComponent(camBuscaOrgao, javax.swing.GroupLayout.PREFERRED_SIZE, 268, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(botBuscar)
                        .addGap(227, 227, 227))
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel29)
                        .addContainerGap())))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                .addContainerGap(11, Short.MAX_VALUE)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel26)
                        .addComponent(jLabel27)
                        .addComponent(jLabel2)
                        .addComponent(jLabel29))
                    .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel25)
                        .addComponent(jLabel28)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(camBuscaSubgrupo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camBuscaNumero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camBusca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camBuscaGrupo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(camBuscaOrgao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(botBuscar)
                    .addComponent(camBuscaArea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        tabela.setFont(new java.awt.Font("Segoe UI", 0, 13));
        tabela.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        tabela.getTableHeader().setReorderingAllowed(false);
        tabela.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                tabelaKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tabelaKeyReleased(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                tabelaKeyTyped(evt);
            }
        });
        jScrollPane2.setViewportView(tabela);

        infoTotal.setFont(new java.awt.Font("Segoe UI", 0, 13));
        infoTotal.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        infoTotal.setText("Total de bens: 0");

        javax.swing.GroupLayout aba2Layout = new javax.swing.GroupLayout(aba2);
        aba2.setLayout(aba2Layout);
        aba2Layout.setHorizontalGroup(
            aba2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, aba2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(aba2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 903, Short.MAX_VALUE)
                    .addComponent(infoTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, 903, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(20, 20, 20))
        );
        aba2Layout.setVerticalGroup(
            aba2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(aba2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(infoTotal)
                .addContainerGap())
        );

        abas.addTab("Consultar Patrimônio", aba2);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(abas, javax.swing.GroupLayout.DEFAULT_SIZE, 928, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(abas, javax.swing.GroupLayout.PREFERRED_SIZE, 576, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void camGrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camGrupoActionPerformed
        try {
            camGrupoNum.setText(Integer.toString(toGrupo.get(camGrupo.getSelectedIndex()).getNumero()));
            trocarSubgrupos();
        } catch (Exception e) {}
    }//GEN-LAST:event_camGrupoActionPerformed

    private void radioBaixaSimActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioBaixaSimActionPerformed
        camTipoBaixa.setEnabled(true);
        camDataBaixa.setEditable(true);
    }//GEN-LAST:event_radioBaixaSimActionPerformed

    private void radioBaixaNaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_radioBaixaNaoActionPerformed
        camTipoBaixa.setEnabled(false);
        camDataBaixa.setEditable(false);
    }//GEN-LAST:event_radioBaixaNaoActionPerformed

    private void botBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botBuscarActionPerformed
        buscar(orgao.get(camBuscaOrgao.getSelectedIndex()).getNumero(), camBuscaArea.getText(), camBuscaGrupo.getText(), camBuscaSubgrupo.getText(),
                camBuscaNumero.getText(), camBusca.getText());
    }//GEN-LAST:event_botBuscarActionPerformed

    private void botNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botNovoActionPerformed
        novo();
    }//GEN-LAST:event_botNovoActionPerformed

    private void botLimparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botLimparActionPerformed
        limparCampos();
    }//GEN-LAST:event_botLimparActionPerformed

    private void botSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_botSalvarActionPerformed
        salvar();
    }//GEN-LAST:event_botSalvarActionPerformed

    private void camBuscaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camBuscaActionPerformed
        buscar(orgao.get(camBuscaOrgao.getSelectedIndex()).getNumero(), camBuscaArea.getText(), camBuscaGrupo.getText(), camBuscaSubgrupo.getText(),
                camBuscaNumero.getText(), camBusca.getText());
    }//GEN-LAST:event_camBuscaActionPerformed

    private void camValorMercadoRealFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camValorMercadoRealFocusLost
        camValorFinalReal.setText(camValorMercadoReal.getText());
    }//GEN-LAST:event_camValorMercadoRealFocusLost

    private void camDataEntradaFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camDataEntradaFocusLost
        if (camDataEntrada.getText().trim().length()==6) {
            camDataEntrada.setText(camDataEntrada.getText().trim()+anoAtual);
        }
    }//GEN-LAST:event_camDataEntradaFocusLost

    private void camDataBaixaFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camDataBaixaFocusLost
        if (camDataBaixa.getText().trim().length()==6) {
            camDataBaixa.setText(camDataBaixa.getText().trim()+anoAtual);
        }
    }//GEN-LAST:event_camDataBaixaFocusLost

    private void camNFDataEntradaFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camNFDataEntradaFocusLost
        if (camNFDataEntrada.getText().trim().length()==6) {
            camNFDataEntrada.setText(camNFDataEntrada.getText().trim()+anoAtual);
        }
    }//GEN-LAST:event_camNFDataEntradaFocusLost

    private void camBuscaGrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camBuscaGrupoActionPerformed
        camBuscaSubgrupo.requestFocus();
    }//GEN-LAST:event_camBuscaGrupoActionPerformed

    private void camBuscaSubgrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camBuscaSubgrupoActionPerformed
        camBuscaNumero.requestFocus();
    }//GEN-LAST:event_camBuscaSubgrupoActionPerformed

    private void camBuscaNumeroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camBuscaNumeroActionPerformed
        buscar(orgao.get(camBuscaOrgao.getSelectedIndex()).getNumero(), camBuscaArea.getText(), camBuscaGrupo.getText(), camBuscaSubgrupo.getText(),
                camBuscaNumero.getText(), camBusca.getText());
    }//GEN-LAST:event_camBuscaNumeroActionPerformed

    private void camBuscaAreaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camBuscaAreaActionPerformed
        camBuscaGrupo.requestFocus();
}//GEN-LAST:event_camBuscaAreaActionPerformed

    private void checkGarantiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkGarantiaActionPerformed
        if (checkGarantia.isSelected()) {
            checkGarantia.setSelected(false);
        } else {
            checkGarantia.setSelected(true);
        }
    }//GEN-LAST:event_checkGarantiaActionPerformed

    private void checkEmprestimoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_checkEmprestimoActionPerformed
        if (checkEmprestimo.isSelected()) {
            checkEmprestimo.setSelected(false);
        } else {
            checkEmprestimo.setSelected(true);
        }
}//GEN-LAST:event_checkEmprestimoActionPerformed

    private void camBuscaAreaFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camBuscaAreaFocusGained
        camBuscaArea.selectAll();
    }//GEN-LAST:event_camBuscaAreaFocusGained

    private void camBuscaGrupoFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camBuscaGrupoFocusGained
        camBuscaGrupo.selectAll();
    }//GEN-LAST:event_camBuscaGrupoFocusGained

    private void camBuscaSubgrupoFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camBuscaSubgrupoFocusGained
        camBuscaSubgrupo.selectAll();
    }//GEN-LAST:event_camBuscaSubgrupoFocusGained

    private void camBuscaNumeroFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camBuscaNumeroFocusGained
        camBuscaNumero.selectAll();
    }//GEN-LAST:event_camBuscaNumeroFocusGained

    private void camBuscaFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camBuscaFocusGained
        camBusca.selectAll();
    }//GEN-LAST:event_camBuscaFocusGained

    private void camAreaNumActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camAreaNumActionPerformed
        camGrupoNum.requestFocus();
    }//GEN-LAST:event_camAreaNumActionPerformed

    private void camGrupoNumActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camGrupoNumActionPerformed
        camSubgrupoNum.requestFocus();
    }//GEN-LAST:event_camGrupoNumActionPerformed

    private void camSubgrupoNumActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camSubgrupoNumActionPerformed
        if (!alterar) {
            mostrarProximoId();
        } else {
            camDescNum.setText(Integer.toString(to.getNumero()));
        }
        camNome.requestFocus();
    }//GEN-LAST:event_camSubgrupoNumActionPerformed

    private void camAreaNumFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camAreaNumFocusGained
        camAreaNum.selectAll();
    }//GEN-LAST:event_camAreaNumFocusGained

    private void camGrupoNumFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camGrupoNumFocusGained
        camGrupoNum.selectAll();
    }//GEN-LAST:event_camGrupoNumFocusGained

    private void camSubgrupoNumFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camSubgrupoNumFocusGained
        camSubgrupoNum.selectAll();
    }//GEN-LAST:event_camSubgrupoNumFocusGained

    private void camAreaNumFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camAreaNumFocusLost
        if (!setarCombo(camAreaNum.getText(), "Área", toArea, camArea)) {
            camArea.setSelectedIndex(0);
            camAreaNum.setText(Integer.toString(toArea.get(0).getNumero()));
            camAreaNum.requestFocus();
        }
    }//GEN-LAST:event_camAreaNumFocusLost

    private void camGrupoNumFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camGrupoNumFocusLost
        if (!setarCombo(camGrupoNum.getText(), "Grupo", toGrupo, camGrupo)) {
            camGrupo.setSelectedIndex(0);
            camGrupoNum.setText(Integer.toString(toGrupo.get(0).getNumero()));
            camGrupoNum.requestFocus();
        }
    }//GEN-LAST:event_camGrupoNumFocusLost

    private void camSubgrupoNumFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camSubgrupoNumFocusLost
        if (!setarCombo(camSubgrupoNum.getText(), "Subgrupo", toSubgrupo, camSubgrupo)) {
            camSubgrupo.setSelectedIndex(0);
            camSubgrupoNum.setText(Integer.toString(toSubgrupo.get(0).getNumero()));
            camSubgrupoNum.requestFocus();
        }
    }//GEN-LAST:event_camSubgrupoNumFocusLost

    private void camAreaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camAreaActionPerformed
        try {
            camAreaNum.setText(Integer.toString(toArea.get(camArea.getSelectedIndex()).getNumero()));
        } catch (Exception e) {}
    }//GEN-LAST:event_camAreaActionPerformed

    private void camSubgrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camSubgrupoActionPerformed
        try {
            camSubgrupoNum.setText(Integer.toString(toSubgrupo.get(camSubgrupo.getSelectedIndex()).getNumero()));
        } catch (Exception e) {}
    }//GEN-LAST:event_camSubgrupoActionPerformed

    private void camLotacaoNumActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camLotacaoNumActionPerformed
        camOrgao.requestFocus();
    }//GEN-LAST:event_camLotacaoNumActionPerformed

    private void camLotacaoNumFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camLotacaoNumFocusGained
        camLotacaoNum.selectAll();
    }//GEN-LAST:event_camLotacaoNumFocusGained

    private void camLotacaoNumFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camLotacaoNumFocusLost
        if (!setarCombo(camLotacaoNum.getText(), "Setor", toSetor, camLotacao)) {
            camLotacao.setSelectedIndex(0);
            camLotacaoNum.setText(Integer.toString(toSetor.get(0).getNumero()));
            camLotacaoNum.requestFocus();
        }
    }//GEN-LAST:event_camLotacaoNumFocusLost

    private void camLotacaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camLotacaoActionPerformed
        try {
            camLotacaoNum.setText(Integer.toString(toSetor.get(camLotacao.getSelectedIndex()).getNumero()));
        } catch (Exception e) {}
    }//GEN-LAST:event_camLotacaoActionPerformed

    private void camAreaItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_camAreaItemStateChanged
        try {
            camArea.setToolTipText(toArea.get(camArea.getSelectedIndex()).getNome());
        } catch (Exception e) {}
    }//GEN-LAST:event_camAreaItemStateChanged

    private void camGrupoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_camGrupoItemStateChanged
        try {
            camGrupo.setToolTipText(toGrupo.get(camGrupo.getSelectedIndex()).getNome());
        } catch (Exception e) {}
    }//GEN-LAST:event_camGrupoItemStateChanged

    private void camSubgrupoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_camSubgrupoItemStateChanged
        try {
            camSubgrupo.setToolTipText(toSubgrupo.get(camSubgrupo.getSelectedIndex()).getNome());
        } catch (Exception e) {}
    }//GEN-LAST:event_camSubgrupoItemStateChanged

    private void camFornecedorItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_camFornecedorItemStateChanged
        try {
            camFornecedor.setToolTipText(toFornecedor.get(camFornecedor.getSelectedIndex()).getNome());
        } catch (Exception e) {}
    }//GEN-LAST:event_camFornecedorItemStateChanged

    private void camLotacaoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_camLotacaoItemStateChanged
        try {
            camLotacao.setToolTipText(toSetor.get(camLotacao.getSelectedIndex()).getNome());
        } catch (Exception e) {}
    }//GEN-LAST:event_camLotacaoItemStateChanged

    private void camNomeFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camNomeFocusGained
        if (!alterar) {
            mostrarProximoId();
        }
    }//GEN-LAST:event_camNomeFocusGained

    private void camBuscaOrgaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camBuscaOrgaoActionPerformed
        try {
            buscar(orgao.get(camBuscaOrgao.getSelectedIndex()).getNumero(), camBuscaArea.getText(), camBuscaGrupo.getText(), camBuscaSubgrupo.getText(),
                    camBuscaNumero.getText(), camBusca.getText());
        } catch (Exception e) {
            //JOptionPane.showMessageDialog(null, "Erro. Detalhes: "+e.getMessage(), "Erro crítico.", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_camBuscaOrgaoActionPerformed

    private void enterNaTabela(KeyEvent e) {
        if (e.getKeyCode()==KeyEvent.VK_ENTER && !camBuscaNumero.isFocusOwner()) {
            mudarAba(0);
            e.consume();
        }
    }

    private void tabelaKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tabelaKeyReleased
        enterNaTabela(evt);
    }//GEN-LAST:event_tabelaKeyReleased

    private void tabelaKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tabelaKeyPressed
        enterNaTabela(evt);
    }//GEN-LAST:event_tabelaKeyPressed

    private void tabelaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tabelaKeyTyped
        enterNaTabela(evt);
    }//GEN-LAST:event_tabelaKeyTyped

    private void camDescNumFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camDescNumFocusLost
        verificarExistenciaNumero(false);
    }//GEN-LAST:event_camDescNumFocusLost

    private void camDescNumActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_camDescNumActionPerformed
        verificarExistenciaNumero(true);
    }//GEN-LAST:event_camDescNumActionPerformed

    private void camDescNumFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_camDescNumFocusGained
        mostrarProximoId();
    }//GEN-LAST:event_camDescNumFocusGained


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel aba1;
    private javax.swing.JPanel aba2;
    private javax.swing.JTabbedPane abas;
    private javax.swing.JButton botBuscar;
    private javax.swing.JButton botLimpar;
    private javax.swing.JButton botNovo;
    private javax.swing.JButton botSalvar;
    private javax.swing.JComboBox camArea;
    private javax.swing.JTextField camAreaNum;
    private javax.swing.JTextField camBloco;
    private javax.swing.JTextField camBusca;
    private javax.swing.JTextField camBuscaArea;
    private javax.swing.JTextField camBuscaGrupo;
    private javax.swing.JTextField camBuscaNumero;
    private javax.swing.JComboBox camBuscaOrgao;
    private javax.swing.JTextField camBuscaSubgrupo;
    private javax.swing.JTextField camChassi;
    private javax.swing.JTextField camDataBaixa;
    private javax.swing.JTextField camDataEntrada;
    private javax.swing.JTextField camDescNum;
    private javax.swing.JComboBox camFornecedor;
    private javax.swing.JComboBox camGrupo;
    private javax.swing.JTextField camGrupoNum;
    private javax.swing.JComboBox camLotacao;
    private javax.swing.JTextField camLotacaoNum;
    private javax.swing.JTextField camNFDataEntrada;
    private javax.swing.JTextField camNFNumero;
    private javax.swing.JTextField camNome;
    private javax.swing.JTextField camNumeroEstado;
    private javax.swing.JTextArea camObservacoes;
    private javax.swing.JComboBox camOrgao;
    private javax.swing.JTextField camPagina;
    private javax.swing.JTextField camProcesso;
    private javax.swing.JTextField camSerie;
    private javax.swing.JComboBox camSituacao;
    private javax.swing.JComboBox camSubgrupo;
    private javax.swing.JTextField camSubgrupoNum;
    private javax.swing.JComboBox camTipoBaixa;
    private javax.swing.JTextField camValorFinalDolar;
    private javax.swing.JTextField camValorFinalReal;
    private javax.swing.JTextField camValorMercadoDolar;
    private javax.swing.JTextField camValorMercadoReal;
    private javax.swing.JCheckBox checkEmprestimo;
    private javax.swing.JCheckBox checkGarantia;
    private javax.swing.JCheckBox checkOutrosComodato;
    private javax.swing.JCheckBox checkOutrosPenhora;
    private javax.swing.ButtonGroup grupoAquisicao;
    private javax.swing.ButtonGroup grupoBaixa;
    private javax.swing.ButtonGroup grupoTipo;
    private javax.swing.JLabel infoTotal;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JRadioButton radioAquisicaoCompra;
    private javax.swing.JRadioButton radioAquisicaoDoacao;
    private javax.swing.JRadioButton radioAquisicaoFabricacao;
    private javax.swing.JRadioButton radioAquisicaoLeasing;
    private javax.swing.JRadioButton radioAquisicaoOutros;
    private javax.swing.JRadioButton radioBaixaNao;
    private javax.swing.JRadioButton radioBaixaSim;
    private javax.swing.JRadioButton radioTipoAquisicao;
    private javax.swing.JRadioButton radioTipoEmprestimo;
    private javax.swing.JTable tabela;
    // End of variables declaration//GEN-END:variables

}

class CellRenderer extends DefaultTableCellRenderer {
    public CellRenderer() {
        super();
    }

    public Component getTableCellRendererComponent(JTable table, Object value,
             boolean isSelected, boolean hasFocus, int row, int column) {
        this.setHorizontalAlignment(CENTER);
        return super.getTableCellRendererComponent(table, value, isSelected,
                 hasFocus, row, column);
     }
}